﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SSN.Utilities.Cache;
using SSN.BusinessFramework;
using SSN.BusinessFramework.Reps;

namespace SSN.WebFramework
{
    public class RepCache : KeyValueCache<string, Rep>
    {
        public RepCache()
            : base(GetRep, new TimeSpan(0, 5, 0))
        {
        }

        private static Rep GetRep(string rep)
        {
            Rep r = new Rep();
            if (r.Load(new AnonymousSecurityContext(), rep))
            {
                return r;
            }

            return null;
        }
    }
}
